<?php
$link = require_once ('./config.php');
$info = array();
$table="talk";
$ip="";
if(isset($_GET['talk']))
    if ($_GET['talk'] == "selftalk")
    {
        $table = "selftalk";
        $cip =$_COOKIE['ip'];
        $ip = "and ip='$cip'";
    }
$id=empty($_GET['maxid'])?0:$_GET['maxid'];
$data = mysqli_query($link, "select * from ".$table." where id>$id ".$ip);
while ($array = mysqli_fetch_assoc($data)) {
    $info[] = $array;
}
if(!$data)
    $info=array();
echo json_encode($info);

